﻿using System;
using System.Collections.Generic;
using System.Text;
using OpenAuth.Repository.Interface;
using OpenAuth.Repository.Core;
using OpenAuth.Repository.Domain;
using System.Data.SqlClient;
using System.Data;
using Infrastructure;

namespace OpenAuth.App
{
    public class ApiBaseApp<T> where T : Entity
    {
        protected IApiRepository<T> Repository;
        public ApiBaseApp(IApiRepository<T> repository)
        {
            Repository = repository;
        }
        public IEnumerable<T> Query<T>(string sql, List<SqlParameter> param) where T : class, new()
        {
            return Repository.ExecuteTran<T>(sql, param);
        }
        public DataTable Put(string sql, List<SqlParameter> param) 
        {
            return Repository.PutTran(sql, param);
        }

    }
}
